<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="/resource/common.jsp"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<%--在押人员列表 --%>
	<title>${title}</title>
	<script type="text/javascript">
	$(function(){
		//给已经勾选的加勾
		var roles = ${checked};
		$.each(roles,function(i,rcode){
			$(":checkbox[value='"+rcode+"']").attr("checked","checked");
		});
		
		window.setTimeout(function(){
	    $("#role1080").hide();
	    $("#role1021").hide();
	    $("#role1101").hide();
	   if(
	      ('1'=='${isadmin}'||'1'=='${iszzb}')
	     )
	  {
	    $("#role1080").show();
	    $("#role1021").show();
	    $("#role1101").show();
	  }
	  },1.5);
	})
		function plusAdd()
		{
					var _checkArr = $("input[type='checkbox']:checked");
					var ids = getIds(_checkArr);
					top.mask();
					$.ajax({
						url:"<%= request.getContextPath()%>/sys/role/plusadd/"+ids+".json",
						data:{userid:'${policeNum}'},
						success:function(data){
							top.showMsg(data.msg.body);
							if("1" == data.msg.status){
								window.setTimeout(function(){
									top.unmask();
									top.closeWin('user');
								},1500);
							}
						},
						error:function(){
							top.unmask();
							top.art.dialog.tips("数据加载出错！");
						}
					});
		}
		function getIds(checkBoxArr) {
				var _size = checkBoxArr.length;
				var _ids = new Array();
				$.each(checkBoxArr, function(index, obj) {
					if ($(obj).val()) {
						_ids.push($(obj).val());
					}
				});
				return _ids.join();
         }
	</script>
<style type="text/css">
html {
overflow-y:auto;
overflow-x:hidden;
}
</style>
</head>
<body>
<form method="post"  style="margin-top:1px">
	<c:forEach items="${list }" var="roles" varStatus="vs">
		<div id="role${roles.rcode}">
			<input style="vertical-align: middle;margin-top: 0;margin-right: 5px;" type="checkbox" name="rcode" value="${roles.rcode }"/>
			${vs.count }. ${roles.rname }
		</div>
	</c:forEach>
</form>
</body>
</html>
